<!-- 加载layout.html -->
{{extend('./layout.html')}}
			
{{#block('main')}}			
	<div class="main-container">
		<div class="padding-md">
			<ul class="breadcrumb">
				<li><span class="primary-font"><i class="icon-home"></i></span><a href="index.html"> 主页</a></li>
				<li>学科管理</li>	 
				<li>学科列表</li>
				<li class="pull-right"><a href="/admin/subject/subject_add" class="btn btn-primary">添加学科</a></li>
			
			</ul>
			<form action="/admin/subject/subject_deleteAll" method="POST">
			<table class="table table-striped" id="dataTable">
				<thead>
					<tr>
						<th class="text-center">
							<button style="display: block;
							margin: 0 auto;
							margin-bottom: 10px;
							background: #e36159;
							border: 1px solid #df4c43;
							padding: 3px 7px;
							border-radius: 5px;
							color: white;" id="dels">批量删除</button>
	
							<div class="custom-checkbox">
	
								<input type="checkbox" id="chkAll" class="inbox-check">
								<label for="chkAll"></label>
							</div>
						</th>
						<th>序号</th>
						<th>学科名称</th>
						<th>学分</th>
					
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					{{#each(subList)}}
					<tr>
						<td class="text-center">
							<div class="custom-checkbox">
								<input type="checkbox" name="ids[]" value="{{this.sub_id}}" id="chk{{xindex+1}}"
									class="inbox-check">
								<label for="chk{{xindex+1}}"></label>
							</div>
						</td>
						<td>{{xindex+1}}</td>
						<td>{{this.sub_name}}</td>
						<td>{{this.sub_score}}</td>
						
						<td>
							<a href="/admin/subject/subject_edit/{{this.sub_id}}" class="btn btn-success">修改</a>
							<a href="javascript:;" class="btn btn-danger widget-remove-option" id="{{this.sub_id}}" ctrname="subject">删除</a>
						</td>
					</tr>
					{{/each}}
				</tbody>
			</table>
			</form>
			<!-- 包含分页文件 -->
			{{include('./page.html')}}
		</div><!-- ./padding-md -->
	</div><!-- /main-container -->
{{/block}}
<script>


$('#chkAll').click(function () {
				if ($(this).prop('checked')) {
					$('.inbox-check').prop('checked', true);
					$('.inbox-check').parent().parent().parent().addClass('active');
				}
				else {
					$('.inbox-check').prop('checked', false);
					$('.inbox-check').parent().parent().parent().removeClass('active');
				}
			});
</script>

